package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.BusinessticketsModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by xiO on 2016/11/9.
 */
@Transactional
public interface BusinessticketsRepository extends JpaRepository<BusinessticketsModel, Integer>,
        JpaSpecificationExecutor<BusinessticketsModel> {

    @Query("select u from BusinessticketsModel u where u.btId=?1")
    BusinessticketsModel getBmodelById(int ids);

    @Query("select u from BusinessticketsModel u where u.btTaxNo=?1")
    BusinessticketsModel getBbmodelByBtTaxNo(String ids);

    @Query("select u from BusinessticketsModel u where u.btName=?1")
    List<BusinessticketsModel> getBbmodelListByBtTaxNo(String ids);

    @Query("select u from BusinessticketsModel u ")
    List<BusinessticketsModel> getBbmodelListbylists();
}
